package com.jwei.form;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@CheckTimeInterval(groups = {GroupEdit.class, GroupAdd.class}, startTime = "releaseStartTime", endTime = "releaseEndTime", message = "发放开始时间不能大于发放结束时间")
public class CouponForm {

    @NotNull(groups = GroupEdit.class, message = "优惠券ID不能为空")
    private Long couponId;

    @NotNull(groups = {GroupEdit.class, GroupAdd.class}, message = "商家ID不能为空")
    private Integer merchantId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date releaseStartTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date releaseEndTime;

}
